<?php
$uid=$_GET['uid'];
	$user_file = "users/".md5($uid)."/settings.json";
	$users = json_decode(file_get_contents($user_file),true);
	if(!isset($users['nickname'])) {
		$users['nickname'] = $uid;
	}
	if(!isset($users['gender'])) {
		$users['gender'] = "unspecified";
	}
	if(!isset($users['accent'])) {
		$users['accent'] = "Oregon, United States";
	}
	if(!isset($users['age'])) {
		$users['age'] = "unspecified";
	}
	if(!isset($users['job'])) {
		$users['job'] = "unspecified";
	}
	if(!isset($users['expertise'])) {
		$users['expertise'] = "Linux driver programming";
	}
	if(!isset($users['brief'])) {
		$users['brief'] = "unsepcified";
	}
	if(!isset($users['identity'])) {
		$users['identity'] = "student";
	}


	if(isset($_GET['nickname']))
		$users['nickname'] = $_GET['nickname'];
	if(isset($_GET['gender']))
		$users['gender'] = $_GET['gender'];
	if(isset($_GET['accent']))
		$users['accent'] = $_GET['accent'];
	if(isset($_GET['age']))
		$users['age'] = $_GET['age'];
	if(isset($_GET['job']))
		$users['job'] = $_GET['job'];
	if(isset($_GET['expertise']))
		$users['expertise'] = $_GET['expertise'];
	if(isset($_GET['brief']))
		$users['brief'] = $_GET['brief'];
	if(isset($_GET['identity']))
		$users['identity'] = $_GET['identity'];
	file_put_contents("$user_file",json_encode($users));
	echo "<script lang=javascript> document.location.href=(\"topframe.php?local=$uid\");</script>";

?>
